//
//  CatogryMainTableModel.m
//  project
//
//  Created by lanou on 15/10/29.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "CatogryMainTableModel.h"

@implementation CatogryMainTableModel

-(instancetype)init
{
    self = [super init];
    if (self)
    {
        _collectionArray = [NSMutableArray arrayWithCapacity:0];
    }
    return self;
}

-(void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"subcategories"])
    {
        NSArray *arr = value;
        for (NSDictionary *modelDic in arr)
        {
            CatogryMainCollectionModel *model = [[CatogryMainCollectionModel alloc]init];
            [model setValuesForKeysWithDictionary:modelDic];
            [_collectionArray addObject:model];
        }
    }
    else
    {
        [super setValue:value forKey:key];
    }
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

@end
